<template>
    <div style="font-size:0.16rem" v-if="xxx">
        <p class="carp">
            <span class="cartime">{{time}}</span>
            <span>订单号:{{ddh}}</span>
            <span class="cardel" @click="del"></span>
        </p>
        <div class="cardiv">
            <div class="carimg">
                <img :src="url" style="width:1.2rem">
            </div>
            <div class="carttext">
                <p>{{cartitle}}</p>
                <p>{{carstyle}}</p>
            </div>
            <div class="num">
                {{carnum}}
            </div>
            <div class="price">
                ￥{{carprice}}
            </div>
            <div class="yifahuo">
                {{isgo}}
            </div>
            <div class="cardivlast">
                <router-link class="ckwl" to>查看物流</router-link><br>
                <span>申请退款</span>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return {
            xxx:true
        }
    },
    props:['time','ddh',"url",'cartitle','carstyle','carnum','carprice','isgo'],
    methods:{
        del(){
            if(confirm("您确定要删除吗")){
                this.axios({
                    url:`${this.$config.dataUrl}/users/order/${this.ddh}`,
                    method:"delete"
                }).then(res=>{
                    console.log(res,"ccc")
                    if(res.data.status==200){
                        alert("删除成功")
                        this.xxx=false;
                    }
                })
            }
        }
    }
}
</script>
<style lang="css" scoped>
    p{
        padding:0;
        margin:0;
    }
    .cardel{
        padding:10px 10px;
        margin-right:40px;
        float:right;
        background:url("../../assets/img/icons/sprite2.png") 0 -55px;
    }
    .cardel:hover{
        background-position:-33px -54px;
    }
    .carp{
        background:#e9e9e9;
        margin-top:.30rem;
    }
    .cartime{
        display:inline-block;
        width:1.65rem;
    }
    .cardiv div{
        float:left;
    }
    .cardiv{
        margin-top:.20rem;
        padding-bottom:.20rem;
        border-bottom:0.01rem solid #ccc
    }
    .carimg{
        width:1.65rem;
    }
    .carttext{
        padding-top:.15rem;
        line-height:.25rem;
        width:2.00rem;
    }
    .cardiv:after{
        content:"";
        display:block;
        clear:both;
        width:0;
        height:0;
    }
    .num{
        width:1.00rem;
        line-height:.80rem;
    }
    .price{
        width:1.50rem;
        line-height:.80rem;
    }
    .yifahuo{
        width:1.50rem;
        line-height:.80rem;
    }
    .cardivlast{
        padding-top:.20rem;
    }
    .ckwl{
        color:#000;
        text-decoration:underline;
    }
</style>